Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream Removal if its Sanity Check Fails #4839

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

GheisMohammadi
Copy link
Contributor

Issue

This PR removes stream from peer store if its sanity check fails.

@GheisMohammadi GheisMohammadi self-assigned this Jan 30, 2025
@@ -693,6 +696,22 @@ func (host *HostV2) Connected(net libp2p_network.Network, conn libp2p_network.Co
}
}

// getPeerTopics returns the list of topics a peer is subscribed to
func (host *HostV2) getPeerTopics(peerID libp2p_peer.ID) map[string]bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that function is currently not used anywhere. Is this required in this PR ? also please write the unit test for this function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function has been added for potential future use. If we later need to retrieve peer topics, we can use it. I included it preemptively because I believe it might be useful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted please the add unit test

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GheisMohammadi can you add unit test for getPeerTopics or maybe create a seperate PR for that function with its test ? what do you think ?

@sophoah sophoah requested a review from Frozen January 30, 2025 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants